package com.hoopeu.entity;

import java.io.Serializable;

import com.hoopeu.utils.camerautils.Constants;

/**
 * @author xst
 *摄像头联系人
 */
public class Contact implements Serializable, Comparable<Contact> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	// 摄像头类型copy
	public static final int UNKNOWN = 0;
	public static final int NPC = 2;
	public static final int PHONE = 3;
	public static final int PC = 4;
	public static final int DOORBELL = 5;
	public static final int IPC = 7;
	public static final int ZHONGRON = 8;
	public static final int ROBOT = 999;

	// id
	public int id;
	// 联系人名称

	public String contactName;
	// 联系人ID
	public String contactId;
	// 联系人监控密码， 注意：不是登陆密码，只有当联系人类型为设备才是
	public String contactPassword;
	// 联系人类型
	public int contactType;
	// 此联系人发来多少条未读消息
	public int messageCount;
	// 当前登录的用户
	public String activeUser;
	// 在线状态， 不保存数据库
	public int onLineState = Constants.DeviceState.CONNECTING;
	// 布放状态，不保存数据
	public int defenceState = Constants.DefenceState.DEFENCE_STATE_LOADING;
	// 记录是否是点击获取布放状态， 不保存数据库
	public boolean isClickGetDefenceState = false;

	// 按在线状态排列
	

	@Override
	public int compareTo(Contact another) {
		// TODO Auto-generated method stub
		Contact o =  another;
		if (o.onLineState > this.onLineState) {
			return 1;
		} else if (o.onLineState < this.onLineState) {
			return -1;
		} else {
			return 0;
		}
	}
}
